<!--
function addRow(){
	
	var newRow = tabActive.insertRow();
	var rowIndex=tabActive.rows.length-2;
	//var cell1 = newRow.insertCell();
	//cell1.innerText = '' + rowIndex;
	
	var cell1 = newRow.insertCell();
	cell1.innerHTML =rowIndex;
	
	var cell1 = newRow.insertCell();
	cell1.innerHTML ="<input type='checkBox' id='num" + rowIndex + "' name='num' value='" + rowIndex + "'/>";

	var cell1 = newRow.insertCell();
	
	cell1.innerHTML="<input type='text' style='width:150px' maxlength='100' name='degree_name' id='degree_name" + rowIndex + "' value='' />";
	
	var cell1 = newRow.insertCell();
	var hstr="";
	hstr ="<SELECT name='start_time_up' id='start_time_up" + rowIndex + "' >";
	for(var i=0;i<10;i++){
		hstr+="<option value='0"+i+"'> 0"+i+" </option>";
	}
	for(var i=10;i<24;i++){
		hstr+="<option value='"+i+"'> "+i+" </option>";
	}
	hstr+="</SELECT>时&nbsp到&nbsp;";
	hstr+="<SELECT name='start_time_down' id='start_time_down" + rowIndex + "' >";
	for(var i=0;i<10;i++){
		hstr+="<option value='0"+i+"'> 0"+i+" </option>";
	}
	for(var i=10;i<=60;i++){
		hstr+="<option value='"+i+"'> "+i+" </option>";
	}
	hstr+="</SELECT>分";
	cell1.innerHTML =hstr;
	
	var cell1 = newRow.insertCell();
	hstr="";
	hstr ="<SELECT name='end_time_up' id='end_time_up" + rowIndex + "' >";
	for(var i=0;i<10;i++){
		hstr+="<option value='0"+i+"'> 0"+i+" </option>";
	}
	for(var i=10;i<24;i++){
		hstr+="<option value='"+i+"'> "+i+" </option>";
	}
	hstr+="</SELECT>时&nbsp到&nbsp;";
	hstr+="<SELECT name='end_time_down' id='end_time_down" + rowIndex + "' >";
	for(var i=0;i<10;i++){
		hstr+="<option value='0"+i+"'> 0"+i+" </option>";
	}
	for(var i=10;i<=60;i++){
		hstr+="<option value='"+i+"'> "+i+" </option>";
	}
	hstr+="</SELECT>分";
	cell1.innerHTML =hstr;
}

function saveDegree(){
	var Items = "";
	var iNext;
	var degree_name=document.getElementsByName("degree_name");
	var start_time_up=document.getElementsByName("start_time_up");
	var start_time_down=document.getElementsByName("start_time_down");
	var end_time_up=document.getElementsByName("end_time_up");
	var end_time_down=document.getElementsByName("end_time_down");
	for(var i=0;i<degree_name.length;i++){
		if(degree_name[i].value==''||start_time_up[i].value==''
		||start_time_down[i].value==''||end_time_up[i].value==''
		||end_time_down[i].value==''){
			alert("度名、开始时间时/分和结束时间时/分不能为空！");
			return false;
		}
	}
	for(var i=0;i<degree_name.length;i++){
		var start_time=start_time_up[i].value+start_time_down[i].value;
		var end_time=end_time_up[i].value+end_time_down[i].value;
		if(start_time>=end_time){
			alert("度数开始时间必须小于结束时间!");
			return false;
		}
	}
	
	for(var i=0;i<degree_name.length-1;i++){
		var start_time=start_time_up[i+1].value+start_time_down[i+1].value;
		var end_time=end_time_up[i].value+end_time_down[i].value;
		if(end_time>start_time){
			alert("度的时间必须按序号从小到大!");
			return false;
		}
	}
	for(var i=0;i<degree_name.length;i++){
		//每一行之间用※分隔，每一个字段之间用`分隔
		if(Items != ""){
			Items += "※";
		}
		iNext = i+1;
		Items += document.getElementById("degree_name"+iNext).value + "`";
		
		Items += document.getElementById("start_time_up"+iNext).value + "`";				
		Items += document.getElementById("start_time_down"+iNext).value + "`";
		
		Items += document.getElementById("end_time_up"+iNext).value + "`";				
		Items += document.getElementById("end_time_down"+iNext).value + "`";
		Items += iNext;
	}
	document.getElementById("itemsVal").value = Items;
	return true;
}

function delRow(){
	if(window.confirm("确定删除吗?")){
		//删除最后一行
		if(tabActive.rows.length<=2){
			alert("没有记录可删除！");
			return;
		}
		var nums=document.getElementsByName("num");
		var temp=true;
		for(var i=nums.length-1;i>=0;i--){
			if(document.getElementById("num"+(i+1)).checked){
				tabActive.deleteRow(i+2);
				temp=false;
			}
		}
		if(temp){
			alert("请选择要删除的记录！");
		}else{
			//重新赋值ID
			var num=document.getElementsByName("num");
			var degree_name=document.getElementsByName("degree_name");
			var start_time_up=document.getElementsByName("start_time_up");
			var start_time_down=document.getElementsByName("start_time_down");
			
			var end_time_up=document.getElementsByName("end_time_up");
			var end_time_down=document.getElementsByName("end_time_down");
			for(var i=0;i<num.length;i++){
				num[i].id="num"+(i+1);
				degree_name[i].id="degree_name"+(i+1);
				start_time_up[i].id="start_time_up"+(i+1);
				start_time_down[i].id="start_time_down"+(i+1);
				
				end_time_up[i].id="end_time_up"+(i+1);
				end_time_down[i].id="end_time_down"+(i+1);
			}
		}
	}
}
//-->